Qubit Gates
We can actually process quantum information using qubits.
Table of Contents
1. Quantum Gates
Logical operations on traditional bits can be represented by matrices. Similarly, a quantum gate is also a linear function, transforming a qubit into another qubit with a few unique features:
- Reversibility. Quantum computers use only reversible operations and never erase any information.
- Non-commutativity when composing gates. Composing gates in different orders results in different computations.
Any qubit gate is described by a \(2 \times 2\) unitary1 matrix \(U\).
Since a unitary is a linear transformation from one basis to another, therefore, any qubit gate can be expressed as
\[ U = \ket{\phi}\bra{\psi} + \ket{\phi^{\perp}}\bra{\psi^{\perp}} \]
where \( \{\ket{\phi}, \ket{\phi^{\perp}}\} \) and \( \{\ket{\psi}, \ket{\psi^{\perp}}\} \) are all orthonormal basis.
Some Important Qubit Gates
| Types | Corresponding Matrix |
|---|---|
| Identity | \( \begin{pmatrix} 1&0\\0&1 \end{pmatrix} \) |
| Negation (Pauli X) | \( \begin{pmatrix} 0&1\\1&0 \end{pmatrix} \) |
| Negation (Pauli Y) | \( \begin{pmatrix} 0&-i\\i&0 \end{pmatrix} \) |
| Negation (Pauli Z) | \( \begin{pmatrix} 1&0\\0&-1 \end{pmatrix} \) |
| Hadamard | \( \frac{1}{\sqrt{2}}\begin{pmatrix} 1&1\\1&-1 \end{pmatrix} \) |
| T or \(\frac{\pi}{4}\)-gate | \( \begin{pmatrix} e^{-i\pi/8}&0\\0&e^{i\pi/8} \end{pmatrix} \) |
For example, the Hadamard gate \( H = \ket{+}\bra{0} + \ket{-}\bra{1} \).
1.1. Intuition of Qubit Gates
Since qubit gates are unitary, it’s equivalent to rotations on Bloch sphere.
1.2. Realizing an Arbitrary Measurement
How can we realize a measurement in an arbitrary basis \( \{\ket{\phi_{0}}, \ket{\phi_{1}}\} \) on a computer that can only measure in \(\{\ket{0}, \ket{1}\}\)?
From the Born’s rule, \(P(x)=|\braket{\phi_{x}|\psi}|^{2}\) for \(x=0,1\). Let \(U\) be a unitary matrix such that \(\ket{\phi_{x}}=U\ket{x}\), by definition, \(\bra{\phi_{x}}=\bra{x}|U^{\dag}\), therefore
\[ P(x) = |\braket{x|U^{\dag}|\psi}|^{2}=|\braket{x|\psi_{U}}|^{2} \]
where \(\ket{\psi_{U}}=U^{\dag}\ket{\psi}\). Therefore, we first execute the inverse of \(U\), and then measure in the computational basis.
Footnotes:
A unitary matrix \(U\) satisfies \(UU^{\dag}=U^{\dag}U=I\), where \(U=\begin{pmatrix}u_{00}&u_{01}\\u_{10}&u_{11}\end{pmatrix}\) while \(U^{\dag}=\begin{pmatrix}u_{00}^{\star}&u_{\textcolor{red}{10}}^{\star}\\u_{\textcolor{red}{01}}^{\star}&u_{11}^{\star}\end{pmatrix}\). This ensures the reversibililty and unity.